package Parse;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import Semant.Semant;

import ErrorMsg.ErrorMsg;
import Absyn.*;

public class CupTest {

	/**
	 * @param args
	 * @throws FileNotFoundException 
	 */
	public static void main(String[] args) throws FileNotFoundException {
		String filename = args[0];
		ErrorMsg errorMsg = new ErrorMsg(filename);
		InputStream inp = new FileInputStream(filename);
		Yylex lexer = new Yylex(inp, errorMsg);
		parser p = new parser(lexer , errorMsg);
		try {
			Exp abs = (Exp)p.parse().value; 
			new Print(System.out).prExp(abs,0);
			System.out.println();
	//		Semant semant = new Semant(errorMsg);
		//	semant.transProg(abs);
			//System.out.println("end");
		} catch (Exception e) {
			// TODO Auto-generated catch block
//			e.printStackTrace();
		}
	}

}
